#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
int main() {    
    pid_t pid = fork();
    if (pid>0)
    {
        for (int i = 0; i < 3; i++)
        {
            printf("我是父进程i = %d,getpid = %d\n",i,getpid());
            sleep(1);
        }
        /* code */
    }else{
        for (int i = 0; i < 3; i++)
        {
            printf("我是子进程j = %d,getpid = %d\n",i,getpid());
            sleep(1);
        }
    }
    return 0;
}